import 'package:enterprise_v6_app/app/components/custom_app_bar.dart';
import 'package:enterprise_v6_app/app/components/special_operation/custom_input_page.dart';
import 'package:enterprise_v6_app/app/components/special_operation/custom_picker_photo.dart';
import 'package:enterprise_v6_app/app/components/special_operation/custom_select_page.dart';
import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/core/ext/ext.dart';
import 'package:enterprise_v6_app/app/modules/application/emergency/home/accident_resubmit/accident_resubmit_controller.dart';

/// 事故续报
class AccidentResubmitPage extends StatelessWidget {
  AccidentResubmitPage({super.key});

  final controller = Get.put(AccidentResubmitController());

  @override
  Widget build(BuildContext context) {
    return GetBuilder(
        init: controller,
        builder: (_) {
          return Scaffold(
            appBar: CustomAppBar(titleText: '接警续报'),
            body: Column(children: [
              Container(color: const Color(0xffF5F5F6), height: 16.w),
              Expanded(
                  child: Container(
                padding: EdgeInsets.symmetric(horizontal: 16.w),
                child: SingleChildScrollView(
                  child: Column(
                    children: [
                      CustomSelectPage(
                        selectText: controller.emergencyBean.getShowName(),
                        title: '事故事件',
                        onCallBack: () {
                          controller.showEmergency();
                        },
                      ),
                      CustomInputPage(
                        title: '事故最新情况',
                        text: controller.entity.accidentUpdate,
                        onCallBack: (value) {
                          controller.entity.accidentUpdate = value;
                        },
                      ),
                      CustomSelectPage(
                        selectText: controller.selectStatus.getShowName(),
                        title: '处置状态',
                        onCallBack: () {
                          controller.showDisposalStatus();
                        },
                      ),
                      CustomPickerPhoto(
                        title: '事故现场图片',
                        imagesList: controller.entity.accidentScenePhotos,
                        titleTextStyle: TextStyle(
                          color: const Color(0xFF262F38),
                          fontSize: 14.sp,
                          fontWeight: FontWeight.w400,
                        ),
                      ),
                      AppGaps.vGap50,
                    ],
                  ),
                ),
              )),
            ]),
            bottomSheet: Container(
              height: 50.w,
              alignment: Alignment.center,
              padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 5.w),
              decoration: BoxDecoration(
                color: Colors.white,
                boxShadow: [
                  BoxShadow(
                    color: const Color(0xffBCBCC5).withOpacity(0.3), // 阴影颜色
                    offset: const Offset(0, -5), // 阴影的偏移量，向上偏移，即上方阴影
                    blurRadius: 10.0, // 阴影的模糊半径
                    spreadRadius: 2.0, // 阴影的扩散半径
                  ),
                ],
              ),
              child: Container(
                  height: 40.w,
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                      color: const Color(0xff5C6DFF),
                      border: Border.all(color: const Color(0xff5C6DFF), width: 1.w),
                      borderRadius: BorderRadius.all(Radius.circular(20.w))),
                  child: Text(
                    '提交',
                    style: TextStyle(
                      fontSize: 16.sp,
                      fontWeight: FontWeight.w500,
                      color: const Color(0xffffffff),
                    ),
                  )).clickOnce(controller.submit),
            ),
          );
        });
  }
}
